<?php
class Admin_Acl_Access_Index_Action extends NICED_Action 
{       
	public function execute() 
	{
        $this->forward("admin.index");

		$controller = $this->getController();
		$request    = $controller->getRequest();			
        $name  = $request->loadParam("name", NULL, "safe");
        $type_id  = $request->loadParam("type_id", 0, "posint");
        $parent_id = $request->loadParam("parent_id", 0, "posint");
        $level     = $request->loadParam("level", 0, "posint");
        $page  = $request->loadParam("page", 1, "posint");
        $page_size  = $request->loadParam("page_size", 10, "posint");

		$model      = $controller->getModel('Admin.Acl.Access.Index');
        
        $params               = array();
        $params["name"]       = $name;
        $params["parent_id"]  = $parent_id;
        $params["type_id"]    = $type_id;
        $params["level"]      = $level;
		try
		{
            $model->getList($page, $page_size, $params);
		}
		catch (Exception $e)
		{
			$controller->handleException($e);
			return self::SUCCESS;
		}

		return self::SUCCESS;
	}

}//end class
